<template>
  <a-drawer
    width="65%"
    title="客户进件审批"
    :label-col="4"
    :wrapper-col="14"
    :visible="open"
    :body-style="{ height: 'calc(100vh - 100px)', overflow: 'auto' }"
    @close="cancel"
  >
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
        <a-row
          :gutter="32"
          style="width: 60%; margin-left: 20%; margin-top: -10px"
        >
          <a-col :span="24" style="margin-left: -120px; margin-bottom: 15px">
            <div style="display: flex; flex-direction: row">
              <span
                style="
                  width: 5px;
                  height: 22px;
                  background-color: coral;
                  display: block;
                "
              ></span>
              <span
                style="
                  margin-left: 5px;
                  height: 22px;
                  line-height: 22px;
                  font-size: 16px;
                  font-weight: 600;
                "
                >客户进件信息</span
              >
            </div>
          </a-col>

          <a-col :span="8">
            <a-form-model-item label="客户姓名" prop="customerName">
              <a-input
                v-model="form.customerName"
                placeholder="请选择客户"
                disabled
                @search="handleOnSearchCustomer"
              >
              </a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="身份证号码" prop="idCard">
              <a-input v-model="form.idCard" placeholder="自动获取" disabled />
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="电话" prop="phone">
              <a-input v-model="form.phone" placeholder="请输入电话" />
            </a-form-model-item>
          </a-col>

          <a-col :span="8">
            <a-form-model-item label="申请金额（元）" prop="yxEdu">
              <a-input-number
                v-model="form.yxEdu"
                :min="0"
                style="width: 100%"
                placeholder="请输入申请金额（元）"
              />
            </a-form-model-item>
          </a-col>

          <a-col :span="8">
            <a-form-model-item label="进件类型" prop="jinjianType">
              <a-select
                placeholder="请选择进件类型"
                v-model="form.jinjianType"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                allow-clear
              >
                <a-select-option
                  v-for="(d, index) in jinjianTypeOptions"
                  :key="index"
                  :value="d.dictValue"
                  >{{ d.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="客服" prop="servcieUserName">
              <a-input
                v-model="form.servcieUserName"
                placeholder="请选择客服"
                disabled
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="24" style="margin-left: -120px; margin-bottom: 15px">
            <div style="display: flex; flex-direction: row">
              <span
                style="
                  width: 5px;
                  height: 22px;
                  background-color: coral;
                  display: block;
                "
              ></span>
              <span
                style="
                  margin-left: 5px;
                  height: 22px;
                  line-height: 22px;
                  font-size: 16px;
                  font-weight: 600;
                "
                >产品信息</span
              >
            </div>
          </a-col>

          <a-row :gutter="32">
            <a-col :span="8">
              <a-form-model-item label="服务机构（一）" prop="orgType">
                <a-select
                  placeholder="请选择服务机构"
                  v-model="form.orgType"
                  :getPopupContainer="
                    (triggerNode) => {
                      return triggerNode.parentNode || document.body;
                    }
                  "
                  style="width: 100%"
                  allow-clear
                  disabled
                >
                  <a-select-option
                    v-for="(d, index) in orgTypeOptions"
                    :key="index"
                    :value="d.dictValue"
                    >{{ d.dictLabel }}</a-select-option
                  >
                </a-select>
              </a-form-model-item>
            </a-col>
            <a-col :span="8">
              <a-form-model-item label="产品名称（一）" prop="productId">
                <a-input v-model="form.productName"> </a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span="8">
              <a-form-model-item label="是否通过" prop="">
                <a-radio-group v-model="form.isTgOne">
                  <a-radio value="1"> 通过 </a-radio>
                  <a-radio value="2"> 未通过 </a-radio>
                </a-radio-group></a-form-model-item
              >
            </a-col>
            <a-col :span="24" v-if="form.isTgOne == 2">
              <a-form-model-item label="未通过说明" prop="">
                <a-input v-model="form.remarkOne" placeholder="未通过说明" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="32" v-if="form.orgTypeTwo">
            <a-col :span="8">
              <a-form-model-item label="服务机构（二）" prop="orgTypeTwo">
                <a-select
                  placeholder="请选择服务机构"
                  v-model="form.orgTypeTwo"
                  :getPopupContainer="
                    (triggerNode) => {
                      return triggerNode.parentNode || document.body;
                    }
                  "
                  style="width: 100%"
                  allow-clear
                  disabled
                >
                  <a-select-option
                    v-for="(d, index) in orgTypeOptions"
                    :key="index"
                    :value="d.dictValue"
                    >{{ d.dictLabel }}</a-select-option
                  >
                </a-select>
              </a-form-model-item>
            </a-col>
            <a-col :span="8">
              <a-form-model-item label="产品名称（二）" prop="productIdTwo">
                <a-input v-model="form.productNameTwo"> </a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span="8">
              <a-form-model-item label="是否通过" prop="">
                <a-radio-group v-model="form.isTgTwo">
                  <a-radio value="1"> 通过 </a-radio>
                  <a-radio value="2"> 未通过 </a-radio>
                </a-radio-group></a-form-model-item
              >
            </a-col>
            <a-col :span="24" v-if="form.isTgTwo == 2">
              <a-form-model-item label="未通过说明" prop="">
                <a-input v-model="form.remarkTwo" placeholder="未通过说明" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="32" v-if="form.orgTypeThree">
            <a-col :span="8">
              <a-form-model-item label="服务机构（三）" prop="orgTypeThree">
                <a-select
                  placeholder="请选择服务机构"
                  v-model="form.orgTypeThree"
                  :getPopupContainer="
                    (triggerNode) => {
                      return triggerNode.parentNode || document.body;
                    }
                  "
                  style="width: 100%"
                  allow-clear
                  disabled
                >
                  <a-select-option
                    v-for="(d, index) in orgTypeOptions"
                    :key="index"
                    :value="d.dictValue"
                    >{{ d.dictLabel }}</a-select-option
                  >
                </a-select>
              </a-form-model-item>
            </a-col>
            <a-col :span="8">
              <a-form-model-item label="产品名称（三）" prop="productIdThree">
                <a-input v-model="form.productNameThree"></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span="8">
              <a-form-model-item label="是否通过" prop="">
                <a-radio-group v-model="form.isTgThree">
                  <a-radio value="1"> 通过 </a-radio>
                  <a-radio value="2"> 未通过 </a-radio>
                </a-radio-group></a-form-model-item
              >
            </a-col>
            <a-col :span="24" v-if="form.isTgThree == 2">
              <a-form-model-item label="未通过说明" prop="">
                <a-input v-model="form.remarkThree" placeholder="未通过说明" />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-col :span="24" style="margin-left: -120px; margin-bottom: 15px">
            <div style="display: flex; flex-direction: row">
              <span
                style="
                  width: 5px;
                  height: 22px;
                  background-color: coral;
                  display: block;
                "
              ></span>
              <span
                style="
                  margin-left: 5px;
                  height: 22px;
                  line-height: 22px;
                  font-size: 16px;
                  font-weight: 600;
                "
                >放款信息</span
              >
            </div>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="放款金额（元）" prop="sjEdu">
              <a-input-number
                v-model="form.sjEdu"
                :min="0"
                style="width: 100%"
                placeholder="请输入放款金额（元）"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="放款时间" prop="qiandanTime">
              <a-date-picker
                v-model="form.fkTime"
                valueFormat="YYYY-MM-DD"
                :show-today="true"
                placeholder="选择日期"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="还款方式" prop="backType">
              <a-select
                placeholder="请选择还款方式"
                v-model="form.backType"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                allow-clear
              >
                <a-select-option
                  v-for="(d, index) in backTypeOptions"
                  :key="index"
                  :value="d.dictValue"
                  >{{ d.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="月供金额（元）" prop="monthAmount">
              <a-input-number
                v-model="form.monthAmount"
                :min="0"
                style="width: 100%"
                placeholder="请输入月供金额（元）"
              />
            </a-form-model-item>
          </a-col>

          <a-col :span="8">
            <a-form-model-item label="分期时间（月数）" prop="fenqiTime">
              <a-input-number
                v-model="form.fenqiTime"
                :min="0"
                style="width: 100%"
                placeholder="请输入分期时间（月数）"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="抵押时间（天数）" prop="diyaTime">
              <a-input v-model="form.diyaTime" placeholder="请输入抵押时间" />
            </a-form-model-item>
          </a-col>

          <a-col :span="8">
            <a-form-model-item label="签单时间" prop="qiandanTime">
              <a-date-picker
                v-model="form.qiandanTime"
                valueFormat="YYYY-MM-DD"
                :show-today="true"
                placeholder="选择日期"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>

          <a-col :span="8">
            <a-form-model-item label="服务费用" prop="serviceAmount">
              <a-input-number
                v-model="form.serviceAmount"
                :min="0"
                style="width: 100%"
                placeholder="请输入服务费用"
                :formatter="(value) => `${value}元`"
                :parser="(value) => value.replace('元', '')"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="费用备注" prop="serviceAmountRemark">
              <a-input
                type="textarea"
                v-model="form.serviceAmountRemark"
                placeholder="请输入费用备注"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
      <div class="bottom-control">
        <a-space>
          <a-button @click="handleJinjianShenhe('-1')" type="danger">
            驳回进件
          </a-button>
          <a-button type="primary" @click="handleJinjianShenhe('3')">
            审批通过
          </a-button>
        </a-space>
      </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import BizJinjianInfoEditForm from "./BizJinjianInfoForm";
export default {
  ...BizJinjianInfoEditForm,
};
</script>
